/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jili.ubert.code.client2server;

import com.baidu.bjf.remoting.protobuf.Codec;
import com.baidu.bjf.remoting.protobuf.ProtobufProxy;
import com.baidu.bjf.remoting.protobuf.annotation.Protobuf;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author dragon
 */
public class RequestBatchOperateDB {
    public static byte[] EnCode(RequestBatchOperateDB msg) throws IOException{
        Codec<RequestBatchOperateDB> Lcode = ProtobufProxy.create(RequestBatchOperateDB.class);
        return Lcode.encode(msg);
    }
    public static RequestBatchOperateDB DeCode(byte[] data) throws IOException{
        Codec<RequestBatchOperateDB> Lcode = ProtobufProxy.create(RequestBatchOperateDB.class);
        return Lcode.decode(data);
        
    }
    @Protobuf
    private int instructionID;
    /*
    1:insert  2.updete 3 delete
    1
    */
    @Protobuf
    private List<byte[]> dataList;//sql

    public int getInstructionID() {
        return instructionID;
    }

    public void setInstructionID(int instructionID) {
        this.instructionID = instructionID;
    }

    public List<byte[]> getDataList() {
        return dataList;
    }

    public void setDataList(List<byte[]> dataList) {
        this.dataList = dataList;
    }
    public void setDataList(byte[] data) {
        if (this.dataList==null){
            this.dataList = new ArrayList(2);
        }
        dataList.add(data);
    }
}
